package com.test.design.pattern.combination;

/**
 * @ClasName MenuItem
 * @Descripution TODO
 * @Author leikw
 * @Date 2021/12/18 11:39
 * @Version V1.0
 */
public class MenuItem extends MenuComponent{

    public MenuItem(String name,int level) {
        this.name = name;
        this.level = level;
    }

    public void print() {
        //打印菜单项的名称
        for(int i = 0; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }

}
